package com.yaosheng.thread.threadPool;

import com.sun.javafx.tk.Toolkit;
import javafx.concurrent.Task;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Created by yaosheng on 2021/7/6.
 */
public class CompletableFutureTest {

    public static void main(String[] args) {

        /**
         * corePoolSize:核心线程数大小
         * maximumPoolSize:最大线程数
         * keepAliveTime:线程存活时间
         * TimeUnit.SECONDS:线程存活时间单位格式
         * ArrayBlockingQueue:任务对列格式
         * Executors.defaultThreadFactory:默认线程工厂
         * Executors.defaultThreadFactory:拒绝策略（JDK默认提供了四种，也可以自定义）
         */
        ThreadPoolExecutor pool = new ThreadPoolExecutor (2,4,60,TimeUnit.SECONDS,
                new ArrayBlockingQueue<Runnable> (4), Executors.defaultThreadFactory (),new ThreadPoolExecutor.DiscardPolicy ());

    }
}
